﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ThongKeSach.aspx.cs" Inherits="ThongKeSach" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link rel="stylesheet" href="Style/jquery-ui-1.10.3.custom.min.css" />
    <script type="text/javascript" src="Scripts/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="Scripts/jquery.mtz.monthpicker.js"></script>
    <script type="text/javascript">

        jQuery(function () {
            var startYear = parseInt(<%=DateTime.Now.Year-20%>);
            var endYear = parseInt(<%=DateTime.Now.Year%>);

            options = {
                pattern: 'mm/yyyy',
                selectedYear: endYear,
                startYear: startYear,
                finalYear: endYear,
                monthNames: ['Jan', 'Fev', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
            };

            jQuery('#<%=txtMonth.ClientID%>').monthpicker(options);
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <table cellspacing="10px">
            <tr>
                <td>Lọai thống kê</td>
                <td>
                    <asp:DropDownList ID="ddlType" runat="server">
                        <asp:ListItem Text="Thống kê theo tên sách" Value="1"/>
                        <asp:ListItem Text="Thống kê theo loại sách" Value="2"/>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>Thời điểm muốn thống kê
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtMonth"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <asp:Button ID="Button1" Text="Xem thống kê" runat="server" CssClass="btn btn-primary" OnClick="GenerateChart"/><br />
                    <asp:Label ID="lblMsg" Text="text" runat="server" CssClass="text-error"/>
                </td>
            </tr>
        </table>
    </div>
    <div>
        <asp:Chart ID="chartThongKe" runat="server" Height="600px" Width="450px">
            <Series>
                <asp:Series XValueMember="Ten" YValueMembers="TongSoLuong"
                    IsVisibleInLegend="true" ChartType="Column">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                    <AxisX LineColor="DarkGray">
                        <MajorGrid LineColor="LightGray" />
                    </AxisX>
                    <AxisY LineColor="DarkGray">
                        <MajorGrid LineColor="LightGray" />
                    </AxisY>
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
    </div>
</asp:Content>

